package teaMainFrame;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import database.Student;

import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JRadioButton;
import javax.swing.JButton;
import java.awt.Font;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class SelectStuInfo extends JFrame {
	private Student s;
	private JPanel contentPane;

	public SelectStuInfo(Student s) {
		this.s = s;
		setVisible(true);
		setLocationRelativeTo(getOwner());
		setResizable(false);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 792, 472);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JPanel panel = new JPanel();
		panel.setLayout(null);
		panel.setBorder(new EmptyBorder(5, 5, 5, 5));
		panel.setBounds(26, 6, 734, 460);
		contentPane.add(panel);
		
		JLabel label = new JLabel("姓名");
		label.setBounds(29, 89, 68, 29);
		panel.add(label);
		
		JLabel label_1 = new JLabel("学号");
		label_1.setBounds(29, 130, 68, 29);
		panel.add(label_1);
		
		JLabel label_2 = new JLabel("性别");
		label_2.setBounds(29, 171, 68, 29);
		panel.add(label_2);
		
		JLabel label_3 = new JLabel("院系");
		label_3.setBounds(29, 212, 68, 29);
		panel.add(label_3);
		
		JLabel label_4 = new JLabel("生日");
		label_4.setBounds(29, 253, 68, 29);
		panel.add(label_4);
		
		JLabel label_5 = new JLabel("入学时间");
		label_5.setBounds(29, 295, 68, 29);
		panel.add(label_5);
		
		JLabel label_6 = new JLabel("政治面貌");
		label_6.setBounds(29, 336, 68, 29);
		panel.add(label_6);
		
		JLabel label_7 = new JLabel("籍贯");
		label_7.setBounds(425, 89, 68, 29);
		panel.add(label_7);
		
		JLabel label_8 = new JLabel("家庭住址");
		label_8.setBounds(425, 130, 68, 29);
		panel.add(label_8);
		
		JLabel label_9 = new JLabel("国籍");
		label_9.setBounds(425, 171, 68, 29);
		panel.add(label_9);
		
		JLabel label_10 = new JLabel("学生信息");
		label_10.setFont(new Font("Lucida Grande", Font.PLAIN, 25));
		label_10.setBounds(312, 27, 106, 31);
		panel.add(label_10);
		
		JLabel label_12 = new JLabel("身份证号");
		label_12.setBounds(425, 212, 68, 29);
		panel.add(label_12);
		
		JLabel getname = new JLabel(s.getName());
		getname.setFont(new Font("Lucida Grande", Font.PLAIN, 18));
		getname.setBounds(126, 95, 106, 23);
		panel.add(getname);
		
		JLabel getid = new JLabel(String.valueOf(s.getId()));
		getid.setFont(new Font("Lucida Grande", Font.PLAIN, 18));
		getid.setBounds(126, 136, 106, 23);
		panel.add(getid);
		
		JLabel getsex = new JLabel(s.getSex());
		getsex.setFont(new Font("Lucida Grande", Font.PLAIN, 18));
		getsex.setBounds(126, 177, 106, 23);
		panel.add(getsex);
		
		JLabel setdepartment = new JLabel(s.getSchool_department());
		setdepartment.setFont(new Font("Lucida Grande", Font.PLAIN, 18));
		setdepartment.setBounds(126, 218, 106, 23);
		panel.add(setdepartment);
		
		JLabel getbirth = new JLabel(s.getBirth());
		getbirth.setFont(new Font("Lucida Grande", Font.PLAIN, 18));
		getbirth.setBounds(126, 259, 225, 23);
		panel.add(getbirth);
		
		JLabel inschooltime = new JLabel(String.valueOf(s.getCollege_time()));
		inschooltime.setFont(new Font("Lucida Grande", Font.PLAIN, 18));
		inschooltime.setBounds(126, 301, 106, 23);
		panel.add(inschooltime);
		
		JLabel getpolitics = new JLabel(s.getPolitics());
		getpolitics.setFont(new Font("Lucida Grande", Font.PLAIN, 18));
		getpolitics.setBounds(126, 342, 106, 23);
		panel.add(getpolitics);
		
		JLabel gethometown = new JLabel(s.getNative_place());
		gethometown.setFont(new Font("Lucida Grande", Font.PLAIN, 18));
		gethometown.setBounds(488, 95, 106, 23);
		panel.add(gethometown);
		
		JLabel getaddress = new JLabel(s.getAdress());
		getaddress.setFont(new Font("Lucida Grande", Font.PLAIN, 18));
		getaddress.setBounds(488, 136, 106, 23);
		panel.add(getaddress);
		
		JLabel getnation = new JLabel(s.getNation());
		getnation.setFont(new Font("Lucida Grande", Font.PLAIN, 18));
		getnation.setBounds(488, 177, 106, 23);
		panel.add(getnation);
		
		JLabel getpersonalid = new JLabel(String.valueOf(s.getPersonalID()));
		getpersonalid.setFont(new Font("Lucida Grande", Font.PLAIN, 18));
		getpersonalid.setBounds(488, 218, 106, 23);
		panel.add(getpersonalid);
		
		JButton btnNewButton = new JButton("返回");
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				setVisible(false);
			}
		});
		btnNewButton.setBounds(557, 394, 117, 29);
		panel.add(btnNewButton);
	}
}
